package com.zyg.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@TableName("student")
@AllArgsConstructor
@NoArgsConstructor
public class Student {
    @TableId(type = IdType.AUTO)
    private Integer sid;
    private String sname;
    private String sex;
    private Integer age;
    private String addr;
    private Integer cid;

    // 自动填充
    @TableField(value = "createTime",fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(value = "updateTime",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    //逻辑删除
    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private String cname;
}
